<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Add Sales Lead</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <h:body> 
            <p:growl id="growl" showDetail="true"/> 

            <h:form>
                <!-- IDLE DIALOG for -->
                <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                 showEffect="bounce" hideEffect="explode"  
                                 header="Warning message" severity="alert" widgetVar="confirmation">  
                    <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                    <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                     actionListener="#{UserManagedBean.doLogout}" /> 
                </p:confirmDialog>

                <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                <!--END OF IDLE DIALOG-->

                <p:confirmDialog message="Have you finished filling the form?"  
                                 showEffect="blind" hideEffect="explode"  
                                 header="Confirmation" severity="alert" widgetVar="confirmation">  

                    <p:commandButton value="Yes" update="panelForm" oncomplete="confirmation.hide()"  
                                     actionListener="#{SalesLeadManagedBean.addSalesLead}" />  
                    <p:commandButton value="No" onclick="confirmation.hide()" type="button" />   

                </p:confirmDialog>  


                <div id="top" class="top">
                    <h:graphicImage value="/image/newHeader.jpg"/>
                </div>

                <div id="content">
                    <table >
                        <tr>
                            <td>
                                <p:toolbar style="font-size:12px;margin-top:0%;height:30px;width:200px"> 
                                    <p:toolbarGroup align="right">
                                        <p:button title="Home" image="ui-icon-home" outcome="SalesDeptWorkspace"/>                                   
                                        <p:button title="Notes" image="ui-icon-note" outcome="tasks"/>                                    
                                        <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>                                     
                                        <p:button title="Edit Preferences" image="ui-icon-gear"/>                                    
                                        <p:button title="Help" image="ui-icon-help"/>
                                        <p:commandButton title="Log Out" immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                                    </p:toolbarGroup>
                                </p:toolbar>
                            </td>
                            <td>   <h:graphicImage value="people-icon.png" style="width:35px;height:35px" />
                                <h:outputText value="       "/>
                                <h:outputText value="New Sales Lead" style="font-size: 20px;font-weight: bolder ;font-family: Tahoma;text-align:left;color: darkblue"/>
                            </td>
                        </tr>
                        <tr>

                            <td style="vertical-align:top">
                                <p:menu style="width:200px;font-size: 12px;font-family: Tahoma;border-style: ridge">  
                                    <p:submenu label="Sales Force Automation" >  
                                        <p:menuitem value="Customers" url="http://localhost:8080/MerlionERP-war/CRM/customers.xhtml" ajax="false" icon="ui-icon ui-icon-person"/>  
                                        <p:menuitem value="Contacts" url="http://localhost:8080/MerlionERP-war/CRM/contacts.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                        <p:menuitem value="Leads" url="http://localhost:8080/MerlionERP-war/CRM/salesLeads.xhtml" ajax="false" icon="ui-icon ui-icon-person" />
                                    </p:submenu>
                                    <p:submenu label="Sales Order Processing">
                                        <p:menuitem value="Pricebooks" url="http://localhost:8080/MerlionERP-war/CRM/pricebooks.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        <p:menuitem value="Inquiries" url="http://localhost:8080/MerlionERP-war/CRM/salesInquiries.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        <p:menuitem value="Quotations" url="http://localhost:8080/MerlionERP-war/CRM/quotations.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        <p:menuitem value="Purchase Orders" url="http://localhost:8080/MerlionERP-war/CRM/purchaseOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        <p:menuitem value="Sales Orders" url="http://localhost:8080/MerlionERP-war/CRM/salesOrders.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                        <p:menuitem value="Delivery Orders" url="http://localhost:8080/MerlionERP-war/CRM/deliveryOrdersCRM.xhtml" ajax="false" icon="ui-icon ui-icon-document"/>
                                    </p:submenu>  
                                </p:menu>
                                <p:menu type="tiered" style="width:200px;font-family:Tahoma;font-size:12px">
                                    <p:submenu label="Create New" icon="ui-icon ui-icon-extlink">  
                                        <p:menuitem value="Customer" url="http://localhost:8080/MerlionERP-war/CRM/createNewCustomer.xhtml" />
                                        <p:menuitem value="Sales Lead" url="http://localhost:8080/MerlionERP-war/CRM/createNewSalesLead.xhtml" /> 
                                        <p:menuitem value="Contact" url="http://localhost:8080/MerlionERP-war/CRM/createNewContact.xhtml" />
                                        <p:menuitem value="Inquiry" url="http://localhost:8080/MerlionERP-war/CRM/addSalesInquiry.xhtml"/>
                                        <p:menuitem value="Quotation" url="http://localhost:8080/MerlionERP-war/CRM/addQuotation.xhtml"/>
                                        <p:menuitem value="Purchase Order" url="http://localhost:8080/MerlionERP-war/CRM/addPurchaseOrder.xhtml"/>
                                        <p:menuitem value="Sales Order" url="http://localhost:8080/MerlionERP-war/CRM/addSalesOrder.xhtml"/>
                                        <p:menuitem value="Delivery Order" url="http://localhost:8080/MerlionERP-war/CRM/addDeliveryOrder.xhtml"/>      
                                    </p:submenu>
                                </p:menu>
                                <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>
                            </td>
                            <td style="vertical-align:top">

                                <p:panel id="panelForm" style="width: 1050px ;font-family: Tahoma;font-size:14px;border-style:hidden">
                                    <center>

                                        <table style="border: 1px solid lightsteelblue;width: 100%" cellpadding="1px" cellspacing="10px" >
                                            <tr  style="background-color: lavender;font-family: Tahoma;font-size:14px;font-weight:bolder;text-align:left" >
                                                <td colspan="6">
                                                    <h:outputText value="Lead Information"/> 
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td>
                                                    <h:outputText value="*Required field(s)" style="font-family:Tahoma;font-size:10px;font-weight:bold"/>
                                                </td>
                                            </tr>


                                            <tr style="font-family:Helvetica;font-size:12px" >


                                                <td width="20%"  > <h:outputLabel for="CompanyName" value="*Company Name" style="font-weight:bold"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText id="CompanyName" value="#{SalesLeadManagedBean.newSalesLead.name}" required="true"/>
                                                    <p:message for="CompanyName"/>
                                                </td>

                                                <td width="20%"> <h:outputLabel for="CompanyRegId" value="*Company Registration ID" style="font-weight:bold" /></td>
                                                <td>  <h:outputText value=": "/></td>
                                                <td>  <p:inputText id="CompanyRegId" required="true" value="#{SalesLeadManagedBean.newSalesLead.companyRegId}"/>
                                                    <p:message for="CompanyRegId"/>

                                                </td>

                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px" >
                                                <td width="20%"> <h:outputText value="Salutation" /></td>
                                                <td> <h:outputText value=": "/></td>
                                                <td> <h:selectOneMenu value="#{SalesLeadManagedBean.newSalesLead.salutation}">
                                                        <f:selectItem itemLabel="-None-" itemValue="-"/>
                                                        <f:selectItem itemLabel="Mr." itemValue="Mr."/>
                                                        <f:selectItem itemLabel="Mrs." itemValue="Mrs."/>
                                                        <f:selectItem itemLabel="Ms." itemValue="Ms."/>
                                                        <f:selectItem itemLabel="Dr." itemValue="Dr."/>
                                                        <f:selectItem itemLabel="Prof." itemValue="Prof."/>
                                                    </h:selectOneMenu></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="First Name" /></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.firstName}" /></td>


                                                <td width="20%"> <h:outputLabel for="BusinessType" value="*Type of Business" style="font-weight:bold" /></td>
                                                <td>  <h:outputText value=": "/></td>
                                                <td>  <h:selectOneRadio required="true" id="BusinessType" value="#{SalesLeadManagedBean.newSalesLead.businessType}">
                                                        <f:selectItem itemValue="Direct" itemLabel="Direct"/>   
                                                        <f:selectItem itemValue="Wholesale" itemLabel="Wholesale"/>
                                                    </h:selectOneRadio>
                                                    <p:message for="BusinessType"/>
                                                </td>

                                            </tr>
                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputLabel for="LastName" value="*Last Name" style="font-weight:bold"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText id="LastName" value="#{SalesLeadManagedBean.newSalesLead.lastName}" required="true"/>
                                                    <p:message for="LastName"/>
                                                </td>

                                                <td width="20%"> <h:outputText value="Industry "/></td>
                                                <td> <h:outputText value=": "/></td>
                                                <td> <h:selectOneMenu value="#{SalesLeadManagedBean.newSalesLead.industry}">
                                                        <f:selectItem itemLabel="-None-" itemValue="-"/>
                                                        <f:selectItem itemLabel="Agriculture" itemValue="Agriculture"/>
                                                        <f:selectItem itemLabel="Apparel" itemValue="Apparel"/>
                                                        <f:selectItem itemLabel="Banking" itemValue="Banking"/>
                                                        <f:selectItem itemLabel="Biotechnology" itemValue="Biotechnology"/>
                                                        <f:selectItem itemLabel="Chemicals" itemValue="Chemicals"/>
                                                        <f:selectItem itemLabel="Communications" itemValue="Communications"/>
                                                        <f:selectItem itemLabel="Construction" itemValue="Construction"/>
                                                        <f:selectItem itemLabel="Consulting" itemValue="Consulting"/>
                                                        <f:selectItem itemLabel="Education" itemValue="Education"/>                              
                                                        <f:selectItem itemLabel="Electronics" itemValue="Electronics"/>
                                                        <f:selectItem itemLabel="Energy" itemValue="Energy"/>
                                                        <f:selectItem itemLabel="Engineering" itemValue="Engineering"/>
                                                        <f:selectItem itemLabel="Entertainment" itemValue="Entertainment"/>
                                                        <f:selectItem itemLabel="Environmental" itemValue="Environmental"/>
                                                        <f:selectItem itemLabel="Finance" itemValue="Finance"/>
                                                        <f:selectItem itemLabel="Food and Beverage" itemValue="Food and Beverage"/>
                                                        <f:selectItem itemLabel="Government" itemValue="Government"/>
                                                        <f:selectItem itemLabel="Healthcare" itemValue="Healthcare"/>
                                                        <f:selectItem itemLabel="Hospitality" itemValue="Hospitality"/>
                                                        <f:selectItem itemLabel="Insurance" itemValue="Insurance"/>
                                                        <f:selectItem itemLabel="Machinery" itemValue="Machinery"/>
                                                        <f:selectItem itemLabel="Manufacturing" itemValue="Manufacturing"/>
                                                        <f:selectItem itemLabel="Media" itemValue="Media"/>
                                                        <f:selectItem itemLabel="Not For Profit" itemValue="Not For Profit"/>
                                                        <f:selectItem itemLabel="Recreation" itemValue="Recreation"/>
                                                        <f:selectItem itemLabel="Retail" itemValue="Retail"/>
                                                        <f:selectItem itemLabel="Shipping" itemValue="Shipping"/>
                                                        <f:selectItem itemLabel="Technology" itemValue="Technology"/>
                                                        <f:selectItem itemLabel="Telecommunications" itemValue="Telecommunications"/>
                                                        <f:selectItem itemLabel="Transportation" itemValue="Transportation"/>
                                                        <f:selectItem itemLabel="Utilities" itemValue="Utilities"/>
                                                        <f:selectItem itemLabel="Other" itemValue="Other"/>

                                                    </h:selectOneMenu></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">

                                                <td width="20%"> <h:outputLabel value="Title"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.title}"/>
                                                </td>

                                                <td width="20%"> <h:outputText value="Department"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.department}" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">

                                                <td width="20%"> <h:outputLabel for="PhoneNumber" value="*Phone Number " style="font-weight:bold"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText id="PhoneNumber" value="#{SalesLeadManagedBean.newSalesLead.contactNum}" required="true"/>
                                                    <p:message for="PhoneNumber"/>
                                                </td>

                                                <td width="20%"> <h:outputText value="Annual Revenue "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.annualRevenue}" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Mobile Number "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.mobileNum}" /></td>

                                                <td width="20%"> <h:outputText value="Number of Employees "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.numOfEmployees}" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Fax Number "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.faxNum}"/></td>

                                                <td width="20%"> <h:outputText value="Website "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText value="#{SalesLeadManagedBean.newSalesLead.website}" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputLabel for="EmailAddress" value="*Email Address " style="font-weight:bold"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:inputText id="EmailAddress" value="#{SalesLeadManagedBean.newSalesLead.emailAddress}" 
                                                         validator="#{UserManagedBean.validateEmail}" required="true" requiredMessage="Email is required." />
                                                    <p:message for="EmailAddress"/>
                                                </td>
                                          

                                                <td width="20%"> <h:outputText value="Date of Birth "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:calendar value="#{SalesLeadManagedBean.newSalesLead.dob}" pattern="dd/MM/yyyy" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Lead Source "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td> <h:selectOneMenu value="#{SalesLeadManagedBean.newSalesLead.leadSource}">
                                                        <f:selectItem itemLabel="-None-" itemValue="-"/>
                                                        <f:selectItem itemLabel="Advertisement" itemValue="Advertisement"/>
                                                        <f:selectItem itemLabel="Employees Referral" itemValue="Employees Referral"/>
                                                        <f:selectItem itemLabel="External Referral" itemValue="External Referral"/>
                                                        <f:selectItem itemLabel="Partner" itemValue="Partner"/>
                                                        <f:selectItem itemLabel="Public Relations" itemValue="Public Relations"/>
                                                        <f:selectItem itemLabel="Seminar - Internal" itemValue="Seminar - Internal"/>
                                                        <f:selectItem itemLabel="Seminar - Partner" itemValue="Seminar - Partner"/>
                                                        <f:selectItem itemLabel="Trade Show" itemValue="Trade Show"/>
                                                        <f:selectItem itemLabel="Web" itemValue="Web"/>
                                                        <f:selectItem itemLabel="Word of Mouth" itemValue="Word of Mouth"/>
                                                        <f:selectItem itemLabel="Other" itemValue="Other"/>
                                                    </h:selectOneMenu></td>

                                                <td width="20%"> <h:outputText value="Rating "/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td><p:rating value="#{SalesLeadManagedBean.newSalesLead.rating}" /></td>
                                            </tr>

                                        </table>

                                        <table style="border: 1px solid lightsteelblue;width: 100%" cellpadding="1px" cellspacing="10px" >
                                            <tr  style="background-color:lavender;font-family: Tahoma;font-size:14px;font-weight:bolder;text-align:left" >
                                                <td colspan="6">
                                                    <h:outputText value="Address Information"/> 
                                                </td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Street Address"/></td>
                                                <td> <h:outputText value=": "/></td>
                                                <td><p:inputTextarea style="width:145px;height:50px;" value="#{SalesLeadManagedBean.newSalesLead.address}" /></td>

                                                <td width="20%"> <h:outputText value="State"/></td>
                                                <td> <h:outputText value=": "/></td>
                                                <td> <p:inputText value="#{SalesLeadManagedBean.newSalesLead.addressState}" /></td>

                                            </tr>
                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"><h:outputText value="Country"/></td>
                                                <td><h:outputText value=": "/></td>
                                                <td>  <p:inputText value="#{SalesLeadManagedBean.newSalesLead.country}" /></td>

                                                <td width="20%">    <h:outputText value="City"/></td>
                                                <td>  <h:outputText value=": "/></td>
                                                <td>   <p:inputText value="#{SalesLeadManagedBean.newSalesLead.city}" /></td>
                                            </tr>

                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Zip Code"/></td>
                                                <td> <h:outputText value=": "/></td>
                                                <td> <p:inputText value="#{SalesLeadManagedBean.newSalesLead.postalCode}" /></td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                            </tr>
                                        </table>

                                        <table style="border: 1px solid lightsteelblue;width: 100%" cellpadding="5px" cellspacing="10px" >
                                            <tr  style="background-color:lavender;font-family: Tahoma;font-size:14px;font-weight:bolder;text-align:left" >
                                                <td colspan="6">
                                                    <h:outputText value="Description Information"/> 
                                                </td>
                                            </tr>
                                            <tr style="font-family:Helvetica;font-size:12px">
                                                <td width="20%"> <h:outputText value="Description"/></td>
                                                <td>  <h:outputText value=": "/></td>

                                                <td><p:inputTextarea style="width:100%;height:100px;" value="#{SalesLeadManagedBean.newSalesLead.description}"/></td>

                                            </tr>
                                        </table>
                                        <p:panel style="text-align:right;font-family:Tahoma;font-size:12px; border-style:hidden">    
                                            <p:commandButton value="Submit" type="submit" onclick="confirmation.show()"/>
                                            <p:commandButton value="Reset" type="reset" /></p:panel>

                                    </center>
                                </p:panel>
                                <p:ajaxStatus style="width:16px;height:16px;">
                                    <f:facet name="start">
                                        <h:graphicImage value="25(2).gif" />
                                    </f:facet>
                                    <f:facet name="complete">
                                        <h:outputText value="" />
                                    </f:facet>
                                </p:ajaxStatus>

                            </td>
                        </tr>
                    </table>
                </div>
                <div id="bottom" class="bottom">
                    <h:graphicImage value="/image/merlionfooter.jpg"/>
                </div>
            </h:form>
        </h:body>
    </f:view>
</html>


